package com.seagox.chat.chat.controller;

import com.seagox.chat.chat.entity.Depart;
import com.seagox.chat.chat.service.IDepartService;
import com.seagox.chat.common.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * 部门
 */
@RestController
@RequestMapping("/depart")
public class DepartController {

	@Autowired
    private IDepartService departService;

    /**
     * 查询所有数据
     */
    @GetMapping("/queryAllData")
    public ResultData queryAllData() {
        return departService.queryAllData();
    }
    
    /**
     * 查询所有用户数据
     */
    @PostMapping("/queryAllUserData")
    public ResultData queryAllUserData(String userId, String disabled) {
        return departService.queryAllUserData(userId, disabled);
    }
    
    /**
     * 添加
     */
    @PostMapping("/insert")
    public ResultData insert(Depart depart) {
        return departService.insert(depart);
    }
    
    /**
     * 编辑
     */
    @PostMapping("/edit")
    public ResultData edit(Depart depart) {
        return departService.edit(depart);
    }
    
    /**
	 * 删除
	 */
	@PostMapping("/delete/{id}")
	public ResultData delete(@PathVariable String id) {
		return departService.delete(id);
	}

}

